home *** CD-ROM | disk | FTP | other *** search
/ Enter 2002 November / EnterCD 11_2002.iso / Internet / Amaya 6.4 / Windows 9x.exe / _SETUP.1 / about_white_space_handling.html < prev    next >
Encoding:
Extensible Markup Language  |  2002-06-11  |  4.0 KB  |  101 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  3.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6.   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  7.   <meta name="generator" content="amaya 5.4, see http://www.w3.org/Amaya/" />
  8.   <title>About White Space Handling</title>
  9.   <style type="text/css">
  10.   </style>
  11.   <link href="../style.css" rel="stylesheet" type="text/css" />
  12. </head>
  13.  
  14. <body xml:lang="en" lang="en">
  15.  
  16. <table border="0" summary="toc">
  17.   <tbody>
  18.     <tr>
  19.       <td><img alt="W3C" src="../../images/w3c_home" /> <img alt="Amaya"
  20.         src="../../images/amaya.gif" /></td>
  21.       <td><p><a href="about_standard_multikey_support.html"
  22.         accesskey="p"><img alt="previous" src="../../images/left.gif" /></a>
  23.         <a href="../EditChar.html" accesskey="t"><img alt="top"
  24.         src="../../images/up.gif" /></a></p>
  25.       </td>
  26.     </tr>
  27.   </tbody>
  28. </table>
  29.  
  30. <div id="page_body">
  31. <h1>About White Space Handling</h1>
  32.  
  33. <p>Amaya removes insignificant white-space characters when it loads a
  34. document unless they must be explicitly preserved. This is true for XHTML,
  35. MathML, and SVG documents, as well as MathML or SVG elements included in a
  36. HTML document,</p>
  37.  
  38. <p>The following are considered as insignificant white-space characters:</p>
  39. <ul>
  40.   <li>End of line characters (<code>#xD</code> and <code>#xA</code>)</li>
  41.   <li>Tab characters (<code>#X9</code>)</li>
  42.   <li>Leading spaces of an element</li>
  43.   <li>Trailing spaces of an element</li>
  44.   <li>Contiguous spaces (one space is preserved)</li>
  45. </ul>
  46.  
  47. <p>To preserve all the characters for some elements, use the
  48. <code>xml:space</code> attribute or the <code>PRE</code> element (only valid
  49. for XHTML documents). The possible values for the <code>xml:space</code>
  50. attribute are <code>default</code> and <code>preserve</code>.</p>
  51. <ul>
  52.   <li>The value <code>default</code> means that an applications' default
  53.     white-space treatment is acceptable for these elements. In Amaya, the
  54.     default treatment removes the insignificant white-space characters for
  55.     all supported DTDs (see above). 
  56.     <p></p>
  57.   </li>
  58.   <li>The value <code>preserve</code> indicates that applications will
  59.     preserve all the characters, except the first one that immediately
  60.     follows the end tag of the element where it is specified, if that element
  61.     is an end of line.</li>
  62. </ul>
  63.  
  64. <p>You apply the <code>xml:space</code> attribute to all elements within the
  65. content of the element where it is specified, unless it is overriden with
  66. another instance of the <code>xml:space</code> attribute.</p>
  67.  
  68. <p>In an XHTML DTD, the <code>PRE</code> element causes the same behavior as
  69. the <code>xml:space</code> attribute with the value <code>preserve</code>.</p>
  70.  
  71. <p>Amaya applies white space handling when it loads a document, not during
  72. editing. A consequence is that if you type insignificant white-space
  73. characters, they will be visible and saved but will be removed the next time
  74. the document is loaded. For example, the following source code:</p>
  75.  
  76. <p><code><p>Amaya removes the <strong> insignificant white-space
  77. </strong>when it loads ...</p></code></p>
  78.  
  79. <p>displays as follows during editing:</p>
  80.  
  81. <p><code>Amaya removes the <strong>insignificant white-space</strong> when it
  82. loads...</code></p>
  83.  
  84. <p>The text will be saved with that syntax. However, the next time the
  85. document is loaded, the text will display as:</p>
  86.  
  87. <p><code>Amaya removes the<strong>insignificant white-space</strong>when it
  88. loads...</code></p>
  89.  
  90. <p>because the leading and trailing spaces of the element
  91. <code><strong></code> are considered to be insignificant and are
  92. removed.</p>
  93.  
  94. <p>The correct source code would be:</p>
  95.  
  96. <p><code><p>Amaya removes the <strong>insignificant
  97. white-space</strong> when it loads ...</p></code></p>
  98. </div>
  99. </body>
  100. </html>
  101.